package string;

public class InternString {
    public static void main(String[] args) {
        String s="DEF";
        String s1="ABC"+s;
        /**
         * .format("%% %dd\n",i);//创建了"%id"
         * %%变成%    %d赋入整数值
         * printf也是如此
         */
        String s3=String.format("%5d",123);//
        String s2="ABC"+s;
        String s4=String.format("%9.3f",123.45);
        System.out.println(s3+" "+s4);
        if (s1==s2)
            System.out.println("s1==s2");
        else
            System.out.println("s1!=s2");
        s1=s1.intern();
        s2=s2.intern();
        if(s1==s2)
            System.out.println("s1==s2");
        else
            System.out.println("s1!=s2");
    }
}
class StringFormat{

}
